home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
comm
/
am120.zip
/
AUTOMATE.SCR
< prev
next >
Wrap
Text File
|
1991-02-15
|
19KB
|
872 lines
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; AutoMate Automated File Transfer Script for Qmodem 4.XX ;;;
;;; By Marc S. Hedish, ABSOLUT(e)LY TEMPORARY (702) 254-8601 ;;;
;;; (C) Copyright 1991 Marc S. Hedish - All Rights Reserved ;;;
;;; Version 1.2 - 02/15/91 - Production Release ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
If "$0" = "AMDIAL" Start
Graphics ANSI
TurnOn 8_BIT
TurnOff ECHO PRINT SPLIT BS_DEL LINEFEED
String QWKFILE REPFILE NAME PROT DOORNUM CMDFILE CMD FILENAME UP DN FIRST
String DESCRIPTION PWORD TEMP OLDATTR STATUS TRIES CONF CHECK LANG PROMPT TYPE
GoTo Start
GetMail:
If "$TYPE" = "QMH" NA
TimeOut 45 Abort
Send "^M"
WaitFor "$PROMPT"
Delay 1000
If "$TYPE" = "SF" SFG
Send "OPEN $DOORNUM^M"
XGetMail:
TimeOut 300 Abort
When "doors are" NoDoors
When "<NO TRANSFER>" NoMsg
When "No Messages Found..." NoMsg
When "<DLASK>" "Y^M"
When "<AUTOSTART>" "^[^["
When "this packet" "Y^M"
When "]oodbye" "Y^M"
When "Type for transfer" "$PROT^M"
When "Begin Your Download" Mega
When "Choice - [" SFM
Assign TRIES 1
Loop6:
WaitFor "Command"
Pause 1000
Send "D$PROT^M"
WaitFor "$QWKFILE"
Mega:
Pause 1000
AtWrite 61 05 031 "Attempt - $TRIES"
Assign CHECK $PROT
Gosub CheckProtocol
Download $PROT $DN$QWKFILE
If $SUCCESS Loop7
WaitFor "Command"
Incr TRIES
If "$TRIES" > "3" FailedGetMail
GoTo Loop6
Loop7:
When "abort automatic" SFMailDone
When "MegaMail" MegaDone
Send "^M"
WaitFor "Command"
Loop7a:
Pause 1000
Readfile CMD
If "$CMD" = "LogOff" Log2
Send "Q^M"
Assign TEMP Skip
MegaDone:
WaitFor "$PROMPT"
Return
SFG:
If "$CMD" = "ExchangeMail" SFG1:
Send "M^M"
WaitFor "$PROMPT"
Delay 1000
SFG1:
Send "$DOORNUM^M"
Assign TEMP SFM
GoTo XGetMail
SFMail:
When "protocol:" "$PROT^M"
When "return you" "Y"
Delay 1000
Send "1^M"
WaitFor "to process:"
Pause 2000
Send "Q^M"
WaitFor "to extract:"
Pause 1000
Send "N"
When "you? [y/n]" "Y^M"
WaitFor "Ready to send"
GoTo Mega
SFMailDone:
When
Send "A"
SFMD:
WaitFor "$PROMPT"
GoTo Loop7a
FailedGetMail:
Decr TRIES
AtWrite 12 06 252 " Failed download of $QWKFILE after $TRIES attempts. "
Stamp Failed download of mail packet $QWKFILE after $TRIES attempts.
Gosub Error
GoTo Loop7
NoDoors:
AtWrite 12 06 252 " Mail door not available at the present time. "
Stamp Mail door not available at the present time.
Gosub Error
Return
NoMsg:
Stamp No messages found to retrieve. Unable to download $QWKFILE.
GoTo Loop7
CheckProtocol:
If "$CHECK" = "G" Abort
If "$CHECK" = "F" Abort
If "$CHECK" = "Y" Abort
If "$CHECK" = "O" Abort
If "$CHECK" = "R" Abort
If "$CHECK" = "C" Abort
If "$CHECK" = "X" Abort
If "$CHECK" = "A" Abort
GetScr
Return
SendReplies:
If "$TYPE" = "QMH" NA
Exist $UP$REPFILE DoIt
AtWrite 18 06 252 " No replies to send. $REPFILE not found. "
Stamp No replies to send. $REPFILE not found.
Gosub Error
Return
DoIt:
TimeOut 45 Abort
Send "^M"
WaitFor "$PROMPT"
Delay 1000
If "$TYPE" = "SF" SFR
Send "OPEN $DOORNUM^M"
SFC:
When "no DOORS are" NoDoors
When "transfer now..." DjSend
When "Reader Now..." DjSend
When "Sorry" CantSend
When "Type for transfer" "$PROT^M"
When "Choice - [" SFM
Assign TRIES 1
Loop8:
WaitFor "Command"
Pause 1000
Send "U$PROT^M"
WaitFor "$REPFILE"
DjSend:
Pause 1000
AtWrite 61 05 031 "Attempt - $TRIES"
Assign CHECK $PROT
Gosub CheckProtocol
Upload $PROT $UP$REPFILE
If $SUCCESS Loop9
Send "^M"
Incr TRIES
If "$TRIES" > "3" FailedSendReplies
GoTo Loop8
Loop9:
If "$CMD" = "ExchangeMail" Abort
If "$TEMP" = "SFM" SFMD
Send "^M"
WaitFor "Command"
GoTo Loop7a
SFR:
Send "M^M"
WaitFor "$PROMPT"
Delay 1000
Send "$DOORNUM^M"
GoTo SFC
SFM:
If "$TEMP" = "SFM" SFMail
When "protocol:" "$PROT^M"
Assign TEMP SFM
Delay 1000
Send "2^M"
WaitFor "abort!"
GoTo DjSend
FailedSendReplies:
Decr TRIES
AtWrite 12 06 252 " Failed upload of $REPFILE after $TRIES attempts. "
Stamp Failed upload of mail packet $REPFILE after $TRIES attempts.
Gosub Error
Send "^M"
GoTo Loop9
CantSend:
Stamp Unable to send replies. Not enough available time.
GoTo Loop9
DeleteReplies:
Exist $UP$REPFILE DelReplyPacket
Return
DelReplyPacket:
DOS "ERASE $UP$REPFILE"
Exist $UP$REPFILE RepliesNotDeleted
Return
RepliesNotDeleted:
AtWrite 12 06 252 " ERROR! - Could not delete replies. "
Stamp Could not delete replies - $UP$REPFILE.
Gosub Error
Return
DeleteMail:
Exist $DN$QWKFILE DelMailPacket
Return
DelMailPacket:
DOS "ERASE $DN$QWKFILE"
Exist $DN$QWKFILE MailNotDeleted
Return
MailNotDeleted:
AtWrite 12 06 252 " ERROR! - Could not delete mail packet. "
Stamp Could not delete mail packet - $DN$QWKFILE.
Gosub Error
Return
ExchangeMail:
Gosub SendReplies
If "$TEMP" = "SFM" GetMail
Exist $UP$REPFILE XGetMail
GoTo GetMail
GetFiles:
TimeOut 45 Loop3
When "] Command" ProGet
When "not found" FileNotFound
When "does not exist" FileNotFound
When "no match." FileNotFound
When "Start your download" GetEm2
When "download of" GetEm2
When "password for downloading?" PwdGet
When "Incorrect" BadPwd
Loop2:
ReadFile FILENAME
If "$FILENAME" = "_EOF_" AbortFile
If "$FILENAME" = " " AbortFile
If "$FILENAME" = "*" AbortFile
AtWrite 61 05 031 " "
AtWrite 61 05 031 "$FILENAME"
Assign TRIES 0
Loop3:
If $OFFLINE Abort
Incr TRIES
Send "^M"
WaitFor "$PROMPT"
Delay 1000
If "$TYPE" = "SF" SFGet
If "$TYPE" = "GAP" SFGet
If "$TYPE" = "QMH" QMGet
Send "D $FILENAME $PROTOCOL^M"
GetEm:
WaitFor "(Ctrl-X)"
GetEm2:
Delay 1000
Assign CHECK $PROTOCOL
Gosub CheckProtocol
Download $PROTOCOL $DN$FILENAME
If $SUCCESS Loop2
Incr TRIES
If "$TRIES" > "3" FailedDownload
GoTo Loop3
SFGet:
If "$TEMP" = "Y" SFGet1
Send "F"
SFGet1:
Send "^M"
WaitFor "$PROMPT"
Assign TEMP Y
Delay 1000
If "$TYPE" = "GAP" GAPGet
When "Protocol" "$PROTOCOL^M"
When "transfer now" "Y^M"
When "Ready to Send" GetEm2
When "not allowed here" Loop3
Send "D^M"
WaitFor "download:"
Delay 1000
Send "$FILENAME^M^M"
WaitFor "$PROMPT"
GoTo Loop3
QMGet:
Send "D^M"
WaitFor "aborts > "
Delay 1000
Send "$PROTOCOL^M"
WaitFor "ends > "
Delay 1000
Send "$FILENAME^M^M"
WaitFor "Cancel"
GoTo GetEm2
GAPGet:
When "(e/c)" "C^M"
When "Log Off" "N^M"
Send "D $FILENAME $PROTOCOL^M^M"
WaitFor "Ready To Send"
GoTo GetEm2
ProGet:
Delay 1000
Send "D $PROTOCOL $FILENAME S^M"
GoTo GetEm
PwdGet:
ReadFile DESCRIPTION
If "$DESCRIPTION" = "_EOF_" Abort
If "$DESCRIPTION" = " " Abort
If "$DESCRIPTION" = "*" Abort
Send "$DESCRIPTION^M"
GoTo GetEm
FailedDownload:
Decr TRIES
Stamp Failed download of $FILENAME after $TRIES attempts.
GoTo Loop2
FileNotFound:
Stamp Failed download. $FILENAME not on $BOARD.
GoTo Loop2
BadPwd:
Stamp Failed download of $FILENAME due to incorrect password.
GoTo Loop2
AbortFile:
If "$TEMP" <> "Y" Abort
Send "^M"
WaitFor "$PROMPT"
Delay 1000
Send "Q^M"
Return
SendFiles:
TimeOut 45 Loop5
When "] Command" ProSend
When "duplicates a current board file." OnFile
When "already exists" OnFile
When "Sorry" NoUploads
When "currently disabled" NoUploads
Loop4:
ReadFile FILENAME
If "$FILENAME" = "_EOF_" AbortFile
If "$FILENAME" = " " AbortFile
If "$FILENAME" = "*" AbortFile
If "$TYPE" = "QMH" SkipDesc
If "$TYPE" <> "GAP" ReadDesc
ReadFile CONF
If "$CONF" = "_EOF_" AbortFile
If "$CONF" = " " AbortFile
If "$CONF" = "*" AbortFile
ReadFile PWORD
If "$PWORD" = "_EOF_" AbortFile
If "$PWORD" = " " AbortFile
If "$PWORD" = "*" AbortFile
ReadDesc:
ReadFile DESCRIPTION
If "$DESCRIPTION" = "_EOF_" AbortFile
If "$DESCRIPTION" = " " AbortFile
If "$DESCRIPTION" = "*" AbortFile
AtWrite 61 05 031 " "
AtWrite 61 05 031 "$FILENAME"
SkipDesc:
Assign TRIES 0
Exist $UP$FILENAME Loop5
AtWrite 12 06 252 " $FILENAME not found in upload directory. "
Stamp Failed upload. $FILENAME not found in upload directory.
Gosub Error
GoTo Loop4
Loop5:
If $OFFLINE Abort
Incr TRIES
Send "^M"
WaitFor "$PROMPT"
Delay 1000
If "$TYPE" = "SF" SFSend
If "$TYPE" = "GAP" SFSend
If "$TYPE" = "QMH" QMSend
Send